﻿using System;
using System.Reflection;

namespace Creventive.Wpf.ShellFactory.Modules
{
    /// <summary>
    ///   Occurs if a plugin module could not be found during the module load phase of application initialization.
    /// </summary>
    [Serializable]
    public class ModuleNotFoundException : ModuleLoadException
    {
        /// <summary>
        ///   Initializes a new instance of the <see cref = "ModuleNotFoundException" /> class.
        /// </summary>
        /// <param name = "assemblyName">Name of the assembly.</param>
        public ModuleNotFoundException(AssemblyName assemblyName)
            : base(assemblyName, "The module " + assemblyName.Name + " could not be found")
        {}

        /// <summary>
        ///   Initializes a new instance of the <see cref = "ModuleNotFoundException" /> class.
        /// </summary>
        /// <param name = "assemblyName">Name of the assembly.</param>
        /// <param name = "inner">The inner.</param>
        public ModuleNotFoundException(AssemblyName assemblyName, Exception inner)
            : base(assemblyName, "The module " + assemblyName.Name + " could not be found", inner)
        {}
    }
}